;;; -*- Mode:LISP; Package:PUSER; Fonts:(METS); Base:10 -*-



(define-predicate my-append
   ((my-append ()))
   ((my-append ?total () . ?back)
     (my-append ?total . ?back))
   ((my-append (?first . ?rest-of-total) (?first . ?rest-of-front) . ?back)
     (my-append ?rest-of-total ?rest-of-front . ?back)))


 28 CALL D-PDL FEF|8          ;#'PROLOG::REST-ARG-FIXUP
 29 MOVE D-LAST LOCAL|0       ;?VARIABLE1
 30 POP LOCAL|4
 31 MOVE D-PDL FEF|7          ;PROLOG::*TRAIL*
 32 POP LOCAL|5               ;MARK
 33 MOVE D-IGNORE LOCAL|4
 34 BR-NOT-NIL 42
 35 MOVE D-PDL ARG|1          ;?VARIABLE0
 36 (MISC) %DEREFERENCE D-PDL
 37 MOVE D-PDL 'NIL
 38 (MISC) %UNIFY-TERM-WITH-TERM D-PDL
 39 BR-NIL-POP 41
 40 CALL0 D-RETURN ARG|0      ;.CONTINUATION.
 41 MOVE D-RETURN PDL-POP
 42 MOVE D-PDL LOCAL|4
 43 (MISC) ATOM D-PDL
 44 (MISC) NOT D-PDL
 45 BR-NIL-POP 58
 46 CAR D-PDL LOCAL|4
 47 MOVE D-PDL 'NIL
 48 (MISC) %UNIFY-TERM-WITH-TERM D-PDL
 49 BR-NIL-POP 58
 50 MOVE D-PDL FEF|9          ;'MY-APPEND
 51 MOVE D-PDL FEF|10         ;'#<DTP-LOCATIVE 21042007>
 52 (MISC) %CURRENT-ENTRYPOINT D-PDL
 53 CALL D-PDL PDL-POP
 54 MOVE D-PDL ARG|0          ;.CONTINUATION.
 55 MOVE D-PDL ARG|1          ;?VARIABLE0
 56 CDR D-PDL LOCAL|4
 57 (MISC) %SPREAD D-LAST
 58 BR-NOT-NIL-POP 84
 59 MOVE D-PDL LOCAL|5        ;MARK
 60 (MISC) %UNTRAIL D-IGNORE
 61 MOVE D-IGNORE LOCAL|4
 62 BR-ATOM 83
 63 CAR D-PDL LOCAL|4
 64 MOVE D-PDL FEF|11         ;'(4000001 . 4000002)
 65 (MISC) %UNIFY-TERM-WITH-TEMPLATE D-IGNORE
 66 BR-NIL 83
 67 MOVE D-PDL ARG|1          ;?VARIABLE0
 68 MOVE D-PDL FEF|12         ;'(14000001 . 4000003)
 69 (MISC) %UNIFY-TERM-WITH-TEMPLATE D-PDL
 70 BR-NIL-POP 82
 71 MOVE D-PDL LOCAL|3        ;?VARIABLE3
 72 MOVE D-PDL LOCAL|2        ;?VARIABLE4
 73 (MISC) %REFERENCE D-PDL
 74 CDR D-PDL LOCAL|4
 75 (MISC) %REFERENCE D-PDL
 76 PUSH-NUMBER 2
 77 MOVE D-PDL FEF|6          ;PROLOG::*PROLOG-WORK-AREA*
 78 (MISC) %INTERNAL-LIST*-IN-AREA D-PDL
 79 POP LOCAL|4
 80 POP ARG|1                 ;?VARIABLE0
 81 BR 31
 82 MOVE D-RETURN PDL-POP
 83 MOVE D-RETURN 'NIL
 84 MOVE D-RETURN PDL-POP

PROLOG::|PUSER::MY-APPEND-IN-:USER-PROVER|



(NAMED-SUBST
 (PROLOG::|PUSER::MY-APPEND-IN-:USER-INNER| (SYSTEM:FUNCTION-PARENT MY-APPEND))
 (PROLOG::.CONTINUATION. PROLOG::?VARIABLE0 #:G0644)
 (DECLARE)
 (PROG
  NIL
  |PUSER::MY-APPEND-IN-:USER-INNER-Label|
  (RETURN
   (LET
    NIL
    (LET
     ((PROLOG::MARK PROLOG::*TRAIL*))
     (COND
      ((AND (EQ #:G0644 NIL))
       (AND (PROLOG::UNIFY (PROLOG::%DEREFERENCE PROLOG::?VARIABLE0) NIL)
            (PROLOG::INVOKE PROLOG::.CONTINUATION.)))
      ((AND
        (AND (CONSP #:G0644)
             (PROLOG::UNIFY (CAR #:G0644) NIL)
             T)
        (LEXPR-FUNCALL
         (PROLOG::CURRENT-ENTRYPOINT 'MY-APPEND)
         (PROLOG::CONTINUATION (PROLOG::INVOKE PROLOG::.CONTINUATION.))
         PROLOG::?VARIABLE0
         (CDR #:G0644))))
      ((PROGN (PROLOG::UNTRAIL PROLOG::MARK) NIL))
      ((AND
        (AND
         (CONSP #:G0644)
         (PROLOG::%UNIFY-TERM-WITH-TEMPLATE
          (CAR #:G0644)
          (PROLOG::MAKE-TEMPLATE (CONS (PROLOG::OCCURRENCE 1 PROLOG::?VARIABLE2)
                                       (PROLOG::OCCURRENCE 1 PROLOG::?VARIABLE4))))
         T))
       (AND
        (PROLOG::%UNIFY-TERM-WITH-TEMPLATE
         PROLOG::?VARIABLE0
         (PROLOG::MAKE-TEMPLATE (CONS (PROLOG::OCCURRENCE 2 PROLOG::?VARIABLE2)
                                      (PROLOG::OCCURRENCE 1 PROLOG::?VARIABLE3))))
        (PROGN
         (PSETQ PROLOG::?VARIABLE0 PROLOG::?VARIABLE3
                #:G0644 (LIST*-IN-AREA PROLOG::*PROLOG-WORK-AREA*
                                       (PROLOG::%REFERENCE PROLOG::?VARIABLE4)
                                       (PROLOG::%REFERENCE (CDR #:G0644))))
         (GO |PUSER::MY-APPEND-IN-:USER-INNER-Label|))))))))))


((PROLOG::|PUSER::MY-APPEND-IN-:USER-PROVER|
  (NAMED-LAMBDA
   (PROLOG::|PUSER::MY-APPEND-IN-:USER-PROVER| (SYSTEM:FUNCTION-PARENT MY-APPEND))
   (PROLOG::.CONTINUATION. PROLOG::?VARIABLE0
                           &REST
                           PROLOG::?VARIABLE1
                           &AUX
                           PROLOG::?VARIABLE2
                           PROLOG::?VARIABLE4
                           PROLOG::?VARIABLE3)
   (DECLARE)
   (BLOCK PROLOG::|PUSER::MY-APPEND-IN-:USER-PROVER|
          (LET ((#:G0644 (PROLOG::REST-ARG-FIXUP PROLOG::?VARIABLE1)))
            (PROLOG::|PUSER::MY-APPEND-IN-:USER-INNER| PROLOG::.CONTINUATION.
                                                       PROLOG::?VARIABLE0
                                                       #:G0644))))))
